package com.salary.utils;

import com.salary.model.SalesInfo;

/**
 * 全局数据存储类，用于存储跨方法和类的共享数据
 */
public class GlobalDataStore {
    // 存储SalaryInfo对象，用于记录销售总量等信息
    private static SalesInfo salesInfo;
    
    /**
     * 获取SalaryInfo对象
     * @return 当前的SalaryInfo对象
     */
    public static SalesInfo getSalaryInfo() {
        if (salesInfo == null) {
            salesInfo = new SalesInfo();
        }
        return salesInfo;
    }
    
    /**
     * 设置SalaryInfo对象
     * @param newSalesInfo 要设置的SalaryInfo对象
     */
    public static void setSalaryInfo(SalesInfo newSalesInfo) {
        salesInfo = newSalesInfo;
    }
} 